#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Type.h"
#include "TimeManagerTest.h"
#include "XmlTest.h"
#include "LuaTest.h"
#include "Time.h"
#include "Log.h"
#include "DbTest.h"
#include "UnitTest.h"

void SystemTypeSizeTest()
{
	printf("=================SystemTypeSizeTest=================\n");
	printf("char size: %d\n", sizeof(char));
	printf("short size: %d\n", sizeof(short));
	printf("int size: %d\n", sizeof(int));
	printf("long size: %d\n", sizeof(long));
	printf("long long size: %d\n", sizeof(long long));
	printf("float size: %d\n", sizeof(float));
	printf("double size: %d\n", sizeof(double));
	printf("size_t size: %d\n", sizeof(size_t));
	printf("time_t size: %d\n", sizeof(time_t));
	printf("point size: %d\n", sizeof(int*));
	printf("=================SystemTypeSizeTest=================\n\n");
}
void LogTest()
{
	printf("=================LogTest=================\n\n");
	for (size_t i = 0;  i < 10; i++ ){
		LogPrintf(i%3+1, "LogTest id:%d year:%d data:%s", i, GetYear(),GetStrTime());
		Pause(500);
		TimeManagerUpdate();
	}
	printf("=================LogTest=================\n\n");
}
int Init()
{
	TimeManager::Instance().Init();
	LogManager::Instance().Init("Log/Test", "Test");
	return 0;
}
int Test()
{
	SystemTypeSizeTest();
	//LogTest();
	//TimeManagerTest::Test();
	//XmlTest::Test();
	//LuaTest::Test();
	//DbTest::Test();
	UnitTest::Test();
	return 0;
}
int main(int argc, char** args)
{
	Init();
	Test();
#ifdef __WINDOWS__
	system("cd");
	system("pause");
#endif
	return 0;
}